    var html = document.documentElement;
    var W = html.getBoundingClientRect().width;
    html.style.fontSize = W / 16 + 'px';
    var flag = false
    var videoObject = {
        container: '#video', //容器的ID或className
        variable: 'player', //播放函数名称
        poster: null,
        flashplayer: false,
        video: null,
    };
    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }
    var TYPE = GetQueryString('type')
    if (TYPE == 3) {
        var timer = setInterval(function() {
            if (flag) {
                var player = new ckplayer(videoObject);
                clearInterval(timer)
            } else {}
        }, 10);
    }
    var app = new Vue({
        created() {
            this.Id = this.GetQueryString('Id');
            this.Type = this.GetQueryString('type');
            console.log(this.Type)
            if (this.Id == null || !this.Id) {} else {
                this.getInfo()
            }
        },
        el: '#app',
        data: {
            AppName: "生活的味道",
            open: "打开",
            ua: null,
            Id: null,
            showCOm: true,
            VideoMess: null,
            DocType: null,
            articleMess: null,
            HotList: null,
            comment: null,
            Live: null,
            ArticlList: null,
            LiveLt: null,
            LiveCOM: null,
            show: false,
            Type: null,
        },
        methods: {
            getInfo: function() { //获取文章或视频调用的接口，是同一个接口
                var Con = document.getElementById('container');
                Con.style.display = 'block'
                var This = this
                if (this.Type == 0 || this.Type == 1) {
                    console.log(11)
                    $.ajax({
                        type: "POST",
                        url: "http://gdtvapp.weixinmvp.top/api/Cms/GetCmsDetailV1",
                        headers: {
                            // 'Content-Type': 'application/json',
                            // 'Access-Control-Allow-Headers': '*'
                        },
                        data: JSON.stringify({
                            Id: this.Id
                        }),
                        success: function(res) {
                            console.log("获取文章或视频调用的接口，是同一个接口")
                            if (res.Data.DocType == "VIDEOLIST") {
                                This.VideoMess = res.Data
                                This.HotVideo()
                                This.Videocomment()
                            } else {
                                This.articleMess = true
                                This.Hotinformation()
                                This.ArticlComment()
                                if (res.ErrorCode === 0) {
                                    var Data = res.Data;
                                    $(".detial").before(
                                        `<h3 style="font-size:22px;font-weight:normal;padding: 5px 0;margin: 10px 0;text-algin:center;">${Data.Title}</h3>` +
                                        `<div style="text-align:left;margin:10px 0;font-size:14px;color:#999;"><span style="margin-right:10px;${Data.SubscriptionName?'':'display:none;'}">${Data.SubscriptionName}</span><span>${Data.UpdateDate}</sapn></div>`
                                    );
                                    if (Data.NewType == 0) { //NewType为0，代表是普通新闻，以Content值为文章内容 NewType为1，代表是图集新闻，以PhotoList值为文章内容
                                        var el = document.createElement('div');
                                        el.id = 'news';
                                        el.style.position = 'relative';
                                        $(el).html(Data.Content);
                                        $(".detial").before(el);
                                    } else {
                                        try {
                                            var newslist = document.createElement('div');
                                            newslist.id = 'photoNews';
                                            JSON.parse(Data.PhotoList).forEach(item => {
                                                $(newslist).before(
                                                    `<div>` +
                                                    `<img src="${item.PicUrl}" style="width:100%;" />` +
                                                    `<p style="" >${item.ListContent}</p>` +
                                                    `</div>`
                                                );
                                            });
                                            $('.detial').before(newslist)
                                        } catch (error) {
                                            alert(error)
                                        }
                                    }
                                    var content;
                                    if (Data.NewType == 0) {
                                        content = document.getElementById('news');
                                    } else {
                                        content = document.getElementById('photoNews');
                                    }
                                    content.style.overflow = 'hidden';
                                    content.style.position = 'relative';
                                    setTimeout(() => {
                                        var toast = document.createElement('div');
                                        $("#cancel").click(function() {
                                            document.getElementById('dialogs').style.display =
                                                'none';
                                            $("#dialogs").hide();
                                        })
                                        $("#appdown").click(function() {
                                            window.location.href =
                                                'http://gdtvnews.weixinmvp.top/download/download.html';
                                        })
                                    }, 1000);
                                } else {
                                    alert(res.ErrorMessage)
                                }
                                $('.articl').find('img').parent().parent().css('textIndent', '0').css('text-align','center')
                                $('.articl').find('img').css('width', "80%").css('text-align','center')
                                $('#news').find('img').css('width', "80%")
                                $('#news').find('img').parent().css('textIndent', '0')
                            }
                        }
                    })
                } else if (this.Type == 2) {
                    $.ajax({
                        type: "POST",
                        url: "http://gdtvapp.weixinmvp.top/api/Cms/GetTopicDetailAndDocList",
                        data: JSON.stringify({
                            "PageIndex": '1',
                            "PageSize": '5',
                            TopicId: 2,
                        }),
                        success: function(res) {
                            This.ArticlList = res.Data;
                            console.log(This.ArticlList)
                        }
                    })
                } else if (this.Type == 3) {
                    var This = this
                    console.log('直播')
                    $.ajax({
                        type: "POST",
                        url: "http://gdtvapp.weixinmvp.top/api/Live/GetLiveDetailV2",
                        data: JSON.stringify({
                            "LiveId": this.Id,
                            "MemberAccount": ""
                        }),
                        success: function(res) {
                            This.Live = res.Data.LiveInfo
                            console.log(This.Live)
                            This.LiveComment()
                            if (This.Live.Status) {

                                videoObject.video = This.Live.LiveUrl.FLV
                            } else {
                                videoObject.poster = This.Live.PhotoUrl
                                videoObject.video = This.Live.ReplayUrl
                            }
                            flag = true;
                            This.RecommendedLive()
                            This.LiveCt()
                        }
                    })
                }
            },
            GetQueryString: function(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]);
                return null;
            },
            isWeiXin() {
                this.ua = window.navigator.userAgent.toLowerCase();
                if (this.ua.match(/MicroMessenger/i) == 'micromessenger') {
                    return true;
                } else {
                    return false;
                }
            },
            HotVideo() {
                var This = this
                $.ajax({
                    type: "POST",
                    url: "http://gdtvapp.weixinmvp.top/api/Live/GetLiveListV2",
                    data: JSON.stringify({
                        "TypeId": "",
                        "PageIndex": 1,
                        "PageSize": 5,
                        "IsHot": "",
                        "Keyword": "",
                        "DocType": "VIDEOLIST",
                        "OrderType": "View",
                        "TopicId": "",
                    }),
                    success: function(res) {
                        This.HotList = res.Data.LiveList
                    }
                })
            },
            Videocomment() {
                var This = this;
                $.ajax({
                    type: "POST",
                    url: "http://gdtvapp.weixinmvp.top/api/Cms/GetComment",
                    data: JSON.stringify({
                        "ObjectId": this.Id,
                        "ParentId": "",
                        "Type": "OBJECT",
                        "PageIndex": 1,
                        "PageSize": 5,
                        "MemberAccount": "",
                        "CommentType": "DOC"
                    }),
                    success: function(res) {
                        This.comment = res.Data
                    }
                })
            },
            Hotinformation() {
                var This = this;

                $.ajax({
                    type: "POST",
                    url: "http://gdtvapp.weixinmvp.top/api/Live/GetLiveListV2",
                    data: JSON.stringify({
                        "TypeId": "",
                        "PageIndex": 1,
                        "PageSize": 5,
                        "IsHot": "",
                        "Keyword": "",
                        "DocType": "NEWSLIS",
                        "OrderType": "View",
                        "TopicId": "",
                    }),
                    success: function(res) {
                        // This.HotList = res.Data.LiveList
                        This.HotList = res.Data.LiveList
                    }
                })
            },
            ArticlComment() {
                var This = this;
                $.ajax({
                    type: "POST",
                    url: "http://gdtvapp.weixinmvp.top/api/Cms/GetComment",
                    data: JSON.stringify({
                        "ObjectId": this.Id, //这个值是由app传过去的
                        "ParentId": "",
                        "Type": "OBJECT",
                        "PageIndex": 1,
                        "PageSize": 5,
                        "MemberAccount": "",
                        "CommentType": "DOC"
                    }),
                    success: function(res) {
                        This.comment = res.Data
                        // console.log(this.HotList)
                    }
                })
            },
            LiveComment() {
                var This = this;
                ///  "直播评论"
                $.ajax({
                    type: "POST",
                    url: "http://gdtvapp.weixinmvp.top/api/Cms/GetComment",
                    data: JSON.stringify({
                        "ObjectId": this.Id, //这个值是由app传过去的
                        "ParentId": "",
                        "Type": "OBJECT",
                        "PageIndex": 1,
                        "PageSize": 5,
                        "MemberAccount": "",
                        "CommentType": "LIVE"
                    }),
                    success: function(res) {
                        console.log("直播评论")
                        console.log(res)
                    }
                })

            },
            click(Id) {
                window.location.href = "http://192.168.3.32:8006/Mass/mobile/index.html?Id=" + Id + "&type=0"
            },
            RecommendedLive() {
                ///  "推荐直播"
                var This = this
                $.ajax({
                    type: "POST",
                    url: "http://gdtvapp.weixinmvp.top/api/Live/GetLiveListV2",
                    data: JSON.stringify({
                        "Type": "",
                        "Keyword": "",
                        "PageIndex": 1,
                        "PageSize": 5,
                        "LiveId": "",
                        "MemberAccount": "",
                        "LiveSatus": 0
                    }),
                    success: function(res) {
                        This.LiveLt = res.Data.LiveList
                    }
                })
            },
            LiveCt: function() {
                var This = this;
                $.ajax({
                    type: "POST",
                    url: "http://gdtvapp.weixinmvp.top/api/Cms/GetComment",
                    data: JSON.stringify({
                        "ObjectId": this.Id, //这个值是由app传过去的
                        "ParentId": "",
                        "Type": "OBJECT",
                        "PageIndex": 1,
                        "PageSize": 5,
                        "MemberAccount": "",
                        "CommentType": "LIVE"
                    }),
                    success: function(res) {
                        This.LiveCOM = res.Data;
                    }
                })
            },
            change(e) {
                var obj = document.getElementsByClassName('span1')[0]
                obj.style.borderBottom = '0px'
                obj.style.color = '#cea77e'
                e.target.style.borderBottom = '2px solid red'
                this.showCOm = false
                e.target.style.color = 'red'

            },
            change1(e) {
                var obj = document.getElementsByClassName('span2')[0]
                obj.style.borderBottom = '0px'
                obj.style.color = '#cea77e'
                this.showCOm = true
                e.target.style.borderBottom = '2px solid red'
                e.target.style.color = 'red'

            }
        }
    })